# config/settings.py
from pydantic_settings import BaseSettings, SettingsConfigDict
from dotenv import load_dotenv

load_dotenv()  # 加载.env文件

class Settings(BaseSettings):
    DB_HOST: str
    DB_NAME: str
    DB_USER: str
    DB_PASSWORD: str
    DB_PORT: int = 3306

    # 推送服务配置
    PUSH_AUTH_BASE_URL: str
    UNIPUSH_APP_ID: str
    UNIPUSH_APP_KEY: str
    UNIPUSH_APP_SECRET: str
    PUSH_API_BASE_URL: str 

    model_config = SettingsConfigDict(
        env_file=".env",
        env_file_encoding="utf-8",
        extra="allow"  # 允许额外字段
    )

# 创建单例配置对象
settings = Settings()